package com.dmooo.yxmmerchant.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.common.glide.GlideUtils;
import com.dmooo.yxmmerchant.R;
import com.dmooo.yxmmerchant.common.Config;
import com.dmooo.yxmmerchant.domain.MyBankBean;

import java.util.List;

public class MyBankAdapter extends BaseQuickAdapter<MyBankBean.BankItem,BaseViewHolder> {
    public MyBankAdapter(int layoutResId, @Nullable List<MyBankBean.BankItem> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MyBankBean.BankItem item) {
        helper.setText(R.id.txt_bank_name,item.bank_name);
        ((ImageView)helper.getView(R.id.img_to)).setImageResource(R.drawable.icon_del);
        helper.setText(R.id.bank_account,item.account+"（"+item.account_name+")");
        GlideUtils.showImageViewToCircle(mContext,mContext.getResources().getDrawable(R.mipmap.defaultpicture_brand),Config.APP_INTERFACE_BASE_URL+item.icon,(ImageView) helper.getView(R.id.img_bank));
        helper.addOnClickListener(R.id.img_to);
    }
}
